//
//  HJBusTicketView.m
//  project
//
//  Created by hu on 2019/4/9.
//  Copyright © 2019 健健. All rights reserved.
//

#import "HJBusTicketView.h"
@interface HJBusTicketView()<UITextViewDelegate>
@property (weak, nonatomic) IBOutlet UIView *ticketBGView;
@property (weak, nonatomic) IBOutlet UILabel *serverMoney;
@property (weak, nonatomic) IBOutlet UIView *ticketInfoBGView;
@property (weak, nonatomic) IBOutlet UILabel *fightName;
@property (weak, nonatomic) IBOutlet UILabel *fightSeat;

/**
 起飞时间
 */
@property (weak, nonatomic) IBOutlet UILabel *starTime;

/**
 到达时间
 */
@property (weak, nonatomic) IBOutlet UILabel *endTime;

/**
 起飞机场
 */
@property (weak, nonatomic) IBOutlet UILabel *starAirport;

/**
 到达机场
 */
@property (weak, nonatomic) IBOutlet UILabel *endAirport;

/**
 机票价格
 */
@property (weak, nonatomic) IBOutlet UILabel *price;

/**
 出行人背景视图view
 */
@property (weak, nonatomic) IBOutlet UIView *tripBgView;

/**
 出行人信息
 */
@property (weak, nonatomic) IBOutlet UIView *tripView;
@property (weak, nonatomic) IBOutlet UILabel *tripName;
@property (weak, nonatomic) IBOutlet UILabel *idCardNum;
@property (weak, nonatomic) IBOutlet UILabel *phoneNum;
@property (weak, nonatomic) IBOutlet UIImageView *statusImage;

/**
 出行人背景
 */
@property (weak, nonatomic) IBOutlet UIView *ticketTripBGView;
@property (weak, nonatomic) IBOutlet UILabel *ticketName;
@property (weak, nonatomic) IBOutlet UILabel *ticketSeat;
@property (weak, nonatomic) IBOutlet UILabel *ticketPosition;
@property (weak, nonatomic) IBOutlet UIImageView *ticketTatusImage;

@property (weak, nonatomic) IBOutlet UITextView *contentTextView;
@property (weak, nonatomic) IBOutlet UILabel *textViewPlaceHolder;

@end
@implementation HJBusTicketView


-(instancetype)init {
    if (self== [super init]) {
        self = [[NSBundle mainBundle]loadNibNamed:@"HJBusTicketView" owner:nil options:nil].firstObject;
    }
    return self;
}
-(void)awakeFromNib {
    [super awakeFromNib];
    [self.ticketBGView rounded:UIRectCornerAllCorners radius:10];
    [self.ticketInfoBGView rounded:UIRectCornerAllCorners radius:10];
    [self.tripBgView rounded:UIRectCornerAllCorners radius:10];
    [self.tripView rounded:UIRectCornerAllCorners radius:10];
    [self.ticketTripBGView rounded:UIRectCornerAllCorners radius:10];
    [self.contentTextView rounded:UIRectCornerAllCorners radius:10 borderColor:[UIColor colorWithHex:0xe5e5e5] borderWidth:1];
    self.contentTextView.delegate =self;
}
- (void)textViewDidEndEditing:(UITextView *)textView {
    NSRange rang = NSMakeRange(0, textView.text.length);
    if ([textView.text isEqualToString:@""] && rang.length == 0) {
        self.textViewPlaceHolder.hidden = NO;
    }
}
-(BOOL)textViewShouldBeginEditing:(UITextView *)textView {
    self.textViewPlaceHolder.hidden = YES;
    return YES;
}
@end
